package com.mxsoft;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class SimpleSocketServer {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(9999);

        while (true) {
            Socket socket = serverSocket.accept();
            InputStream inputStream = socket.getInputStream();

            String line = null;
            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)) ;

            while ((line = bufferedReader.readLine()) != null) {
                System.out.println(line);
            }

        }
    }
}
